package com.sxbbc.common.core.mapper.jz;

import com.sxbbc.common.core.entity.jz.CShoppingCart;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;

import java.util.List;

import org.apache.ibatis.annotations.Param;

/**
 * <p>
 * 用户商品购物车 Mapper 接口
 * </p>
 *
 * @author leehao
 * @since 2019-06-03
 */
public interface CShoppingCartMapper extends BaseMapper<CShoppingCart> {

    /**
     * 查询用户购物车 根据店铺id分组
     * @param cid 用户id
     * @author leehao
     * @return java.util.List<com.sxbbc.common.core.entity.jz.CShoppingCart>
     */
    List<CShoppingCart> queryShoppingGroupByBid(@Param("cid")Integer cid ,@Param("type")Integer type);

    List<CShoppingCart> queryShoppingByCid(@Param("param")CShoppingCart shoppingCart,@Param("type")Integer type);

    /**
     * 根据店铺划分订单
     * @param cid
     * @param shopIds
     * @return
     */
	List<Integer> queryMoreBid(@Param("cid")Integer cid, @Param("shopIds")List<Integer> shopIds);
	
	/**
	 * 查询属于该店铺的购物车数据，归为一个订单
	 * @param cid
	 * @param bid
	 * @param shopIds
	 * @return
	 */
	List<CShoppingCart> queryShopByBidAndShopIds(@Param("cid")Integer cid, @Param("bid")Integer bid, @Param("shopIds")List<Integer> shopIds);

	/**
	 * 查询附近商家用户购物车
	 * @param cid
	 * @param bid
	 * @param onOff
	 * @return
	 */
	List<CShoppingCart> queryShoppingByBid(@Param("cid")Integer cid, @Param("bid")Integer bid, @Param("onOff")Integer onOff);
}
